<template>
	<view class="zone">
		<Header title="好友记录"></Header>
		<view class="main">
			<image class="yun" src="http://image.qxgm.site/tdz/img/public/m_yun.png" mode="widthFix"></image>
			<image class="ping1" src="http://image.qxgm.site/tdz/img/public/ping1.png" mode="widthFix"></image>

			<view class="box">
				<scroll-view scroll-y class="scrollbox" @scrolltolower="scrolltolower">
					<view class="item" v-for="(item , index) in listdata" :key="index">
						<image class="header" :src="item.avatar" mode="widthFix"></image>
						<view class="ybox">
							<view class="name">
								{{item.username}}
							</view>
							<view class="sind">
								ID:{{item.invite_code}}
							</view>
						</view>
						<view class="right">
							<view class="sbang">
								{{item.status.name}}
							</view>
							<view class="time">
								{{item.create_time}}
							</view>
						</view>
					</view>

					<view class="empty" v-if="listdata == ''">
						<image src="http://img.cpgm.cc/xfmz/static/public/empty.png" mode="widthFix" />
						<text class="hui">
							没有数据哦~
						</text>
					</view>
				</scroll-view>
			</view>


		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listdata: [],
				
			}
		},
		onShow() {

		},
		onLoad() {
			this.friendhelps();
		},
		methods: {
			
			// 好友记录
			async friendhelps() {
				let res = await this.$http.index.friendhelps({
                    type:2
				})
				if (res.code == 1) {
					this.listdata = res.data
				}
			},
		}
	}
</script>

<style lang="less">
	.zone {
		min-height: 100vh;
		background: url(http://image.qxgm.site/tdz/img/public/p_bg.png) no-repeat;
		background-size: 100% auto;
	}

	.main {
		width: 100%;
		position: relative;
		margin-top: 10px;
	}

	.yun {
		position: absolute;
		top: -3%;
		left: 0;
		width: 44%;
		z-index: 9;
	}

	.box {
		background: url(http://image.qxgm.site/tdz/img/public/ping2.png);
		background-size: 100% auto;
		padding: 10px 6px 0;
	}

	.scrollbox {
		height: calc(100vh - 107px);
		overflow-y: scroll;
	}

	.ping1 {
		width: 100%;
		display: flex;
	}

	.title {
		display: flex;
		align-items: center;
		justify-content: center;
		background: url(http://image.qxgm.site/tdz/img/xianyu/mg-05.png) no-repeat;
		background-size: 100% 100%;
		padding: 0px 0 18px;

		image {
			width: 18%;
		}

		text {
			font-size: 20px;
			font-weight: normal;
			color: #50463E;
			line-height: 20px;
			margin: 0 13px;
		}
	}

	.item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: url(http://image.qxgm.site/tdz/img/xianyu/mg-06.png) no-repeat;
		background-size: 100% 100%;
		margin-bottom: 2px;
		padding: 13px 9px;
		box-sizing: border-box;
	}


	.header {
		width: 47px;
	}

	.name {
		font-size: 14px;
		font-weight: normal;
		color: #333333;
		line-height: 14px;
		margin-bottom: 9px;
		white-space: nowrap;
		/*不允许换行*/
		overflow: hidden;
		/*超出隐藏*/
		text-overflow: ellipsis;
	}

	.ybox {
		flex: 1;
		margin-left: 4px;
		width: 0%;
	}

	.sind {
		font-size: 14px;
		font-weight: normal;
		color: #333333;
		line-height: 14px;
	}

	.right {
		position: relative;
		text-align: center;
	}

	.sbang {
		width: 85px;
		font-size: 14px;
		font-weight: normal;
		height: 29px;
		line-height: 29px;
		color: #fdf5c7;
		text-shadow: 0 1px 1px #CB6500;
		background: url(http://image.qxgm.site/tdz/img/yaoyuan/smg-07.png) no-repeat;
		background-size: 100% 100%;
		margin-bottom: 16px;
	}

	.sbang2 {
		width: 85px;
		font-size: 14px;
		font-weight: normal;
		height: 29px;
		line-height: 29px;
		color: #fdf5c7;
		text-shadow: 0 1px 1px #CB6500;
		background: url(http://image.qxgm.site/tdz/img/yaoyuan/smg-08.png) no-repeat;
		background-size: 100% 100%;
		margin-bottom: 16px;
	}

	.time {
		width: 130px;
		position: absolute;
		bottom: -9px;
		right: 0px;
		font-size: 12px;
		font-weight: normal;
		color: #333333;
		line-height: 24px;
	}
</style>